<template>
  <div class="registerForm">
    <el-form :model="registerForm">
      <el-form-item label="用户名">
        <el-input
          v-model="registerFormData.username"
          placeholder="请输入内容"
        ></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input
          v-model="registerFormData.password"
          placeholder="请输入内容"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="register">register</el-button>&nbsp;
        <router-link to="/login">
          <el-button type="primary">login</el-button>
        </router-link>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { reactive } from "vue";
export default {
  name: "register",
  setup() {
    const registerFormData = reactive({ username: "", password: "" });
    function register() {
      console.log(registerFormData.username, registerFormData.password);
    }
    return { registerFormData, register };
  },
};
</script>

<style scoped>
.registerForm {
  margin: 100px auto;
  padding: 10px;
  width: 700px;
  height: 300px;
  border: 1px solid black;
}
</style>